import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/layout/layout.vue'
import Login from '@/views/login/index.vue'
import IndexView from '@/views/index/index.vue'
import userView from '@/views/user/index.vue'
import categoryView from '@/views/category/index.vue'
import supplierView from '@/views/supplier/index.vue'
import pcdView from '@/views/pcd/index.vue'
import GoodsView from '@/views/goods/index.vue'
import warehouseView from '@/views/warehouse/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Layout,
      children:[
        {path:'/',redirect:'/login'},
        {path:'/index',name:'index',component:IndexView},
        {path:'/user',name:'user',component:userView},
        {path:'/category',name:'category',component:categoryView},
        {path:'/supplier',name:'supplier',component:supplierView},
        {path:'/pcd',name:'pcd',component:pcdView},
        {path:'/goods',name:'goods',component:GoodsView},
        {path:'/warehouse',name:'warehouse',component:warehouseView},
      ],
    },{path:'/login',name:'login',component:Login}
  ],
})

export default router
